﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models;

namespace DAL
{
    public class HouseService
    {
        /// <summary>
        /// 房屋信息查询
        /// </summary>
        /// <returns></returns>
        public static List<House> Housesselect() 
        {
            using (ExpertDBEntities db=new ExpertDBEntities())
            {
                return db.House.ToList();
            }
        }
        /// <summary>
        /// 房屋信息添加
        /// </summary>
        /// <param name="house"></param>
        /// <returns></returns>
        public static bool HouseAdd(House house)
        {
            using (ExpertDBEntities db=new ExpertDBEntities())
            {
                db.House.Add(house);
                return db.SaveChanges() > 0;
            }
        }
    }
}
